package lambda;

import java.util.Arrays;
import java.util.Comparator;

/**
 * @author: wh(1835734390 @ qq.com)
 * @date: 2023/2/22 13:39
 * @description:
 * @version:
 */
public class Test {
    public static void main(String[] args) {
        Integer[] array = {2,1,3,6,4};
        Arrays.sort(array, new Comparator<Integer>() {
            @Override
            public int compare(Integer o1, Integer o2) {
                return o2 - o1;
            }
        });

        Arrays.sort(array,(o1,o2) -> o2 - o1);
    }
}
